import request from '@/utils/request';

/**
 * 获取流程列表
 */
export function getProcessList() {
  return request({
    url: '/api/process/list',
    method: 'get'
  });
}

/**
 * 获取流程详情
 * @param {string} id 流程ID
 */
export function getProcessDetail(id) {
  return request({
    url: `/api/process/${id}`,
    method: 'get'
  });
}

/**
 * 创建流程
 * @param {Object} data 流程数据
 */
export function createProcess(data) {
  return request({
    url: '/api/process/create',
    method: 'post',
    data
  });
}

/**
 * 更新流程
 * @param {string} id 流程ID
 * @param {Object} data 流程数据
 */
export function updateProcess(id, data) {
  return request({
    url: `/api/process/${id}`,
    method: 'put',
    data
  });
}

/**
 * 删除流程
 * @param {string} id 流程ID
 */
export function deleteProcess(id) {
  return request({
    url: `/api/process/${id}`,
    method: 'delete'
  });
}

/**
 * 运行流程
 * @param {string} id 流程ID
 */
export function runProcess(id) {
  return request({
    url: `/api/process/${id}/run`,
    method: 'post'
  });
}

/**
 * 停止流程
 * @param {string} id 流程ID
 */
export function stopProcess(id) {
  return request({
    url: `/api/process/${id}/stop`,
    method: 'post'
  });
} 